const apiBase = "https://api.it120.cc/jiaxiang";
export const Request = (params) => {
  wx.showLoading({
    title: "加载中...",
  });
  return new Promise((resolve, reject) => {
    wx.request({
      ...params,//请求参数

      url: apiBase + params.url,//服务器url+参数中携带的接口具体地址

      header: {
        "content-type": "application/x-www-form-urlencoded",
      },
      success: (data) => {
        resolve(data.data);
      },
      fail: (err) => {
        reject(err);
      },
      complete: wx.hideLoading,
    });
  });
};
